﻿using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AmaroK86.MassEffect3.DLC;

namespace AmaroK86.MassEffect3.DLCExplorer2
{
    public partial class generalProperties : Form
    {
        public generalProperties(sfarFile entry)
        {
            InitializeComponent();

            int cprSize = entry.blockSizeIndex == -1 ? (int)entry.uncompressedSize : entry.blockSizeArray.Sum(a => (int)a);
            int uncSize = (int)entry.uncompressedSize;

            this.Text = "Property - " + Path.GetFileName(entry.fileName);
            textBoxFileName.Text = Path.GetFileName(entry.fileName);
            textBoxHashName.Text = entry.nameHash.ToString();
            labelFileType1.Text = "(" + Path.GetExtension(entry.fileName) + ") file";
            textBoxPath.Text = Path.GetDirectoryName(entry.fileName);
            labelCompressedSize1.Text = cprSize.ToString("N0") + " bytes";
            labelUncompressedSize1.Text = uncSize.ToString("N0") + " bytes";
            labelCompressionRatio1.Text = ((float)cprSize / (float)uncSize * (float)100).ToString("0.#") + "%";
        }
    }
}
